<?php


	class userModel extends Model{
		
		protected  $_validate = array(
			array('email','email','不合法的Email格式'),
			array('email','','此Email已经存在',0,'unique','add'),
			array('username','require','姓名必须！'),
			array('password','require','密码必须！'),
			array('network_city','require','网络必须！'),
			array('password2','password','密码不一致',0,'confirm'), // 验证确认密码是否和密码一致

		/*
			array('email','email','Email格式不对'),
			array('email','',L('hasemail'),0,'unique','add'),
			array('username','require',L('nousername')),
			array('password','require',L('nopassword')),
			array('network_city','require',L('nonetwork')),
			array('password2','password',L('noequalpassword'),0,'confirm'), // 验证确认密码是否和密码一致
			$notemail = L('notemail');
			$hasemail = L('hasemail');
			$nousername = L('nousername');
			$nopassword = L('nopassword');
			$nonetwork = L('nonetwork');
			$noequalpassword = L('noequalpassword');
		*/
		);
		
		protected $_auto = array(
			array('password','md5','ADD','function'),
			array('regtime','getNowTime','ADD','function'),
			array('logintime','getNowTime','ADD','function'),
		);
		
		
		protected $_link = array(
			array(
				'mapping_type' => HAS_ONE,
				'class_name' => 'user_info',
				'foreign_key'=>'userid',
				'mapping_name'=>'user_info',
			)
		);
		
		
	}
?>